package com.qiall.omsserver.service.maven;

import com.qiall.bashutil.MavenScripUtil;
import com.qiall.omsserver.data.entity.AppCodeInfo;
import com.qiall.omsserver.data.mapper.AppCodeInfoMapper;
import com.qiall.omsserver.data.mapper.GitBranchMapper;
import com.qiall.omsserver.service.GitManageService;
import com.qiall.omsserver.service.MavenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class MavenServiceImpl implements MavenService {


    @Autowired
    private GitManageService gitManageService;

    @Autowired
    private AppCodeInfoMapper appCodeInfoMapper;


    @Autowired
    private GitBranchMapper gitBranchMapper;

    private MavenScripUtil mavenScripUtil;

    @Override
    public void mvmPackage(Integer appId){
        AppCodeInfo codeInfo = appCodeInfoMapper.selectByAppId(appId);
        String codePath = codeInfo.getCodePath();
        mavenScripUtil.mvmPackage(codePath,appId);
    }

    @Override
    public void mvnInstall(Integer appId){
        AppCodeInfo codeInfo = appCodeInfoMapper.selectByAppId(appId);
        String codePath = codeInfo.getCodePath();
        mavenScripUtil.mvnInstall(codePath,appId);

    }
}
